package com.wharf.base.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wharf.base.dao.GoodsCarMapper;
import com.wharf.base.dao.GoodsMapper;
import com.wharf.base.model.GoodsCar;

@Service
public class GoodsCarServiceImp implements GoodsCarService{
  
	@Autowired
	public GoodsCarMapper goodscarmapper;
	
	////生成购物车数据
	@Override
	public int addCar(Integer userId) {
		// TODO Auto-generated method stub
		return goodscarmapper.addCar(userId);
	}
	
	////根据用户id查询商品的id
	@Override
	public List<GoodsCar> selectGoodsIdByUserId(Integer userId) {
		// TODO Auto-generated method stub
		return goodscarmapper.selectGoodsIdByUserId(userId);
	}

	@Override
	public int addGoodsIdInCar(Integer userId) {
		// TODO Auto-generated method stub
		return goodscarmapper.insertIntoCar(userId);
	}

}
